${htmlCode}
<script type="text/javascript">
var sbase='${sbase}';
$(function(){
       $(".gonext").bind("click",function(){
             //alert(this.step+" , "+this.action+" , "+this.entityid);
            submitData();
            
       });
       $(".otherAttachment").click(function(){
             showAtts();
       });
      
       $(".closeForm").click(function(){
             window.close();
       });
       $("textarea[name=标题内容]").text('${formtitle}');
            
}); 
     function submitData(){
         
         var fm = $("<form action='admin/form/show/generate-html!saveform' method='POST' target='_self'></form>");
       	 $.each($("form :text,:radio,:checkbox,textarea,select"),function(i ,node){
		     var n = $(node);
		     
		     var nameElement = $("<input type='hidden'></input>");
		     var nameName="formElements["+i+"].name";
		     nameElement.attr("name",nameName);
		     nameElement.val(n.attr("name"));
		     fm.append(nameElement);
		     
		     var valueName = "formElements["+i+"].value";
		     var valueElement = $("<input type='hidden'></input>");
		     valueElement.attr("name",valueName);
		     valueElement.val(n.val());
		     fm.append(valueElement);
		     
		     
		     var checkName = "formElements["+i+"].checked";
		     var checkElement = $("<input type='hidden'></input>");
		     checkElement.attr("name",checkName);
		     checkElement.val(n.attr("checked"));
		     fm.append(checkElement);		     
		     
	     });
	     
	     var actionElement = $("<input type='hidden' name='actionId' value='#{actionId}'></input>");
	     var entityElement = $("<input type='hidden' name='workflowId' value='#{workflowId}'></input>");
	     var stepElement = $("<input type='hidden' name='stepId' value='#{stepId}'></input>");
	     
	     <#if template??>
	     	var tempElement = $("<input type='hidden' name='template.id' value='${template.id}'></input>");
	      	fm.append(tempElement);
	     </#if>
	     fm.append(actionElement);
	     fm.append(entityElement);
	     fm.append(stepElement);
	     $("body").append(fm);  
         fm.get(0).submit();
     }
     function showAtts(){
           var link = '${base}admin/attachment/attachment!start?workflowId=#{workflowId}';		
	       doAjaxLinkById(link,"attachments"); 
     }
     var user = '${localName}'||'未登录'; 
     function setOwner(obj){
        
        $(obj).val(user);  
     }
     function setUserName(id){
        var t = $("#"+id);
        if(t.attr("disabled")==true){
           
        }else{
          $("#"+id).val(user+" "+formatDate(new Date())); 
        }
        
     }
</script>
<style type="text/css">
.disableInput{
    border:#ffffff 1px solid;  
}
.ctrldiv{
    width:600px;
    margin: 0 auto;    
}
.gonext,.otherAttachment , .closeForm{
    width:150px;
    height:30px;
    border:#345 1px solid;
    font-size:16px;
    font-weight:bolder;
    background-color:#355;
    color:#fff;
}
.gonext{
    background-color:#9acd32;
} 
.gonext:hover{
    background-color:#6b8e23;
} 
</style>